Conversation
|
@eddumelendez can you a look at this? Needs a workflow approval to run CI. |
This allows disabling the Ryuk container via a property, while being backwards compatible with the existing environment variable. Solves testcontainers#11413.
|
Hi, you can achieve the same goal configuring your build tool Maven <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<environmentVariables>
<TESTCONTAINERS_RYUK_DISABLED>true</TESTCONTAINERS_RYUK_DISABLED>
</environmentVariables>
</configuration>
</plugin>Gradle tasks.named("test", Test) {
environment "TESTCONTAINERS_RYUK_DISABLED", "true"
} |
|
We don't use either of these build tools (we are on Bazel) and it's easier (and better) to do it via the This property is backwards compatible with the other properties following the testcontainers guidelines. |
|
There are other reason why we are not supporting this in the property file that I am no recalling right now, but, will share later. |
|
See #4950 (comment) |
|
Our CI environment cannot run privileged containers, and we have a significant number of users running rootless Docker/Podman where Ryuk can be problematic. My understanding from the documentation is that Ryuk is supposed to be optional. Supporting this configuration via the properties file simplifies centralized governance. For example, we maintain a central testing library that configures Testcontainers for a specific use case. Managing this configuration via a properties file within this library is significantly more maintainable than having to add the corresponding environment variable in all relevant test targets. Unless I misunderstood, there doesn't seem to be a strong reason to not support this as a property in the thread you shared. This PR is following the established configuration guidelines and doesn't change the existing behaviour for the broader community. It provides a standard alternative for environments where environment variables are "expensive" to manage or the running environment is more restrictive. On another note, it seems that this request comes every now and then, and it seems to be one of the few configuration properties that is only available as an environment variable. |
|
This property exists for Go. https://golang.testcontainers.org/features/configuration/#customizing-ryuk-the-resource-reaper
Maybe we can bridge this gap. |
This allows disabling the Ryuk container via a property, while being backwards compatible with the existing environment variable.
Solves #11413.